**************************************************************** Replication Code for ** Book "The Credibility Challenge: How Democracy Aid Influences Election Violence"** Inken von Borzyskowski ** Cornell University Press 2019  **** Last Updated: June 2019**************************************************************// OS X Mojave// Software: Stata 14.2 SE// Set working directory to the location of replication data and load data*cd "~/"use "Book_data.dta", clear* Install if you have not yet* ssc install texsave************************************************** Figure I.1 *************************************************use "Book_data.dta", clearsort killedinjuredlog WB_GDPpc_Lag1Logby killedinjuredlog WB_GDPpc_Lag1Log: generate n1 = _nby killedinjuredlog WB_GDPpc_Lag1Log: generate n2 = _Ntwoway (scatter killedinjuredlog WB_GDPpc_Lag1Log [w=n2], msize(small) msymbol(Oh) mcol(black) ///	xline(7.90, lwidth(medium) lpattern(shortdash) lcol(black))) ///	(scatteri 4.8 7.9 (3) "natural log ($2,700) = 7.9", msymbol(i) mlabsize(medium) mlabcolor(black)) ///	(lowess killedinjuredlog WB_GDPpc_Lag1Log, lpattern(solid) lcolor(black)) ///	(scatteri  1 4.2 (3) "Trend", msymbol(i) mlabsize(medium) mcol(black) mlabcolor(black)) , ///	ytitle("Number of Election-Related Casualties (logged)")  ylabel(, angle(0)) ///	xtitle("Per capita GDP (logged)") ///	graphregion(color(white)) bgcolor(white) legend(off) plotregion(lcolor(black)) ylabel(, nogrid)graph export "Figure_I_1.pdf", replace	************************************************** Figure I.2 *************************************************use "Book_data.dta", clearsort post_killedInjuredlog VDEM_v2elembcap_ordby post_killedInjuredlog VDEM_v2elembcap_ord: generate n1 = _nby post_killedInjuredlog VDEM_v2elembcap_ord: generate n2 = _Ntwoway (lfit post_killedInjuredlog VDEM_v2elembcap_ord, lpattern(solid) lcolor(black)) ///	(scatter post_killedInjuredlog VDEM_v2elembcap_ord [w=n2], msize(small) msymbol(Oh) mcol(black)) ///	(scatteri  1 0.2 (3) "Trend", msymbol(i) mlabsize(medium) mcol(black) mlabcolor(black)), ///	ytitle("Number of Election-Related Casualties (logged)")  ///	xtitle("Election Commission Capacity") plotregion(margin(large))   ///	graphregion(color(white)) bgcolor(white) legend(off) ylabel(, angle(0)) plotregion(lcolor(black)) ylabel(, nogrid)	graph export "Figure_I_2.pdf", replace	************************************************** Figure I.3 - graphing see R code *************************************************use "Book_dataglobal.dta", clearegen AvgUNTA=mean(UNtech), by(cowcode)sort cowcode year collapse (first) AvgUNTA COUNTRY_NAME, by(cowcode)export delimited using "UNmap.csv", nolabel replace  ************************************************** Figure I.4*************************************************use "Book_dataglobal.dta", clearegen UNtechPercent=mean(UNtech*100), by(continent1)egen IEMPercent=mean(present46*100), by(continent1)graph bar IEMPercent UNtechPercent, ///	over(continent1, sort(IEMPercent) descending relabel(4 `""Latin America &" "the Caribbean" "' 3 `" "Europe &"  "North America" "')label(labsize(small))) ///	blabel(total, format(%9.0f)) /// 	ytitle(Percent of Elections with Election Assistance) ylabel(, angle(0)) 	///	scheme(lean1) aspectratio(0.70) ylab(0(20)70) graphregion(margin(vlarge)) ///	legend(label(1 "Observation") label(2 "Technical Assistance") ring(0) bmargin(b-20 t20 l-12.5 r12.5) region(lcolor(black)) row(1) col(2)) ylabel(, nogrid)graph export "Figure_I_4.pdf", replace************************************************** Figure I.6*************************************************	use "Book_dataglobal.dta", cleargraph box VDEM_v2elembcap_ord, ///	over(continent1, sort(1) ///	relabel(4 `""Latin America &" "the Caribbean" "' 3 `" "Europe &"  "North America" "')) ///	scheme(lean1) ylabel(, nogrid) ytitle("Election Commission Capacity") ///	medtype(marker) medmarker(msymbol(diamond)) graph export "Figure_I_6.pdf", replace************************************************** Table 1.1, Figure 1.3 and 1.4 - Latex* Figure 2.1 - see R code *************************************************	*************************************************	* Table 2.1 						 *************************************************use "Book_data.dta", clearset more offlocal dv PreDay_killedInjuredlocal controls Polity_xconst_Lag1 ///	 Prio_CWPast10   WB_GDPpc_Lag1Log ///	Ross_oilgas_valuePOP2000_Lag1LOG Finkel_SOC10 WB_pop_Lag1Log ///	  type3    Nelda_IncRun killedANY_Lag1  zinb `dv'  present46  			`controls'    , inflate ( WB_GDPpc_Lag1Log Prio_CWPast10 )  vce(cluster cowcode) difficult technique (bfgs)est store Table_2_1m1zinb `dv'    			UNtech 	`controls'    , inflate ( WB_GDPpc_Lag1Log Prio_CWPast10 )  vce(cluster cowcode)est store Table_2_1m2zinb `dv'  present46	UNtech 	`controls'     , inflate ( WB_GDPpc_Lag1Log Prio_CWPast10 )  vce(cluster cowcode) difficult technique (bfgs)est store Table_2_1m3zinb `dv'  ObsTA  			`controls'    , inflate ( WB_GDPpc_Lag1Log Prio_CWPast10 )  vce(cluster cowcode) difficult technique (bfgs)est store Table_2_1m4zinb `dv'  present46  			`controls'    if Africa==1, inflate ( WB_GDPpc_Lag1Log Prio_CWPast10 )  vce(cluster cowcode)est store Table_2_1m5zinb `dv'    			UNtech 	`controls'    if Africa==1, inflate ( WB_GDPpc_Lag1Log Prio_CWPast10 )  vce(cluster cowcode)est store Table_2_1m6zinb `dv'  present46	UNtech 	`controls'     if Africa==1, inflate ( WB_GDPpc_Lag1Log Prio_CWPast10 )  vce(cluster cowcode) difficult technique (bfgs)est store Table_2_1m7zinb `dv'  ObsTA  			`controls'    if Africa==1, inflate ( WB_GDPpc_Lag1Log Prio_CWPast10 )  vce(cluster cowcode) difficult technique (bfgs)est store Table_2_1m8// Table 2.1  estout Table_2_1m*   ///	using Table_2_1.tex, replace style(tex) eqlabels(none)  cells(b(fmt(%9.3f) star) ///	se(par fmt(%9.3f))) stats(N N_clust aic bic ll alpha, fmt(0 0 2) label("Observations" "Clusters" "AIC" "BIC" "LL" "Alpha")) ///	starlevels(* .1 ** .05 *** .01) label ///	order(present46 UNtech ObsTA ///	Polity_xconst_Lag1 ///	 Prio_CWPast10   WB_GDPpc_Lag1Log ///	Ross_oilgas_valuePOP2000_Lag1LOG Finkel_SOC10 WB_pop_Lag1Log ///	  type3    Nelda_IncRun killedANY_Lag1) 	  	  	  	************************************************** Table 2.2*************************************************use "Book_data.dta", clearset more offlocal controls_SelIEM PreviousANYElobservedW46  OppoCompetition UncertainElection  WB_GDP_Lag1Log WB_GDPpc_Lag1Log year  local controls_SelTEA Autocracy  AdvDem  WB_GDPpc_Lag1Log  Prio_CWPast10  UNPKO_dummy  type3 UncertainElection OppoCompetition  logit present46	PreDay_killedInjuredLog  `controls_SelIEM'  , cluster(cowcode)est store Table_2_2m1	logit present46	PreDay_killedInjuredLog  `controls_SelIEM' ///	type3   Autocracy  AdvDem  Prio_CWPast10  UNPKO_dummy , cluster(cowcode)est store Table_2_2m2logit present46	CasualtiesSUMBINARY  			`controls_SelIEM' , cluster(cowcode)est store Table_2_2m3	logit present46	CasualtiesSUMBINARY  			`controls_SelIEM' ///	type3   Autocracy  AdvDem  Prio_CWPast10  UNPKO_dummy, cluster(cowcode)est store Table_2_2m4logit UNtech	PreDay_killedInjuredLog  `controls_SelTEA' 			, cluster(cowcode)est store Table_2_2m5logit UNtech	PreDay_killedInjuredLog `controls_SelTEA' ///	  PreviousANYElobservedW46 WB_GDP_Lag1Log year, cluster(cowcode)est store Table_2_2m6logit UNtech	CasualtiesSUMBINARY  			`controls_SelTEA' 			, cluster(cowcode)est store Table_2_2m7logit UNtech	CasualtiesSUMBINARY 			`controls_SelTEA' ///	PreviousANYElobservedW46 WB_GDP_Lag1Log year, cluster(cowcode)est store Table_2_2m8// Table 2.2 estout Table_2_2m*   ///	using Table_2_2.tex, replace style(tex) eqlabels(none)  cells(b(fmt(%9.3f) star) ///	se(par fmt(%9.3f))) stats(N N_clust ll , fmt(0 0 2) label("Observations" "Clusters" "LL")) ///	starlevels(* .1 ** .05 *** .01) label ///	order(PreDay_killedInjuredLog CasualtiesSUMBINARY ///	 OppoCompetition UncertainElection  PreviousANYElobservedW46 WB_GDP_Lag1Log WB_GDPpc_Lag1Log  year ///	type3 Autocracy  AdvDem  Prio_CWPast10  UNPKO_dummy )		************************************************** Table 2.3*************************************************use "Book_data.dta", clearset more offlocal controls Polity_xconst_Lag1 ///	 Prio_CWPast10   WB_GDPpc_Lag1Log ///	Ross_oilgas_valuePOP2000_Lag1LOG Finkel_SOC10 WB_pop_Lag1Log ///	  type3    Nelda_IncRun local controls_SelIEM PreviousANYElobservedW46 OppoCompetition UncertainElection   WB_GDP_Lag1Log WB_GDPpc_Lag1Log year local controls_SelTEA Autocracy  AdvDem  WB_GDPpc_Lag1Log  Prio_CWPast10  UNPKO_dummy  type3 UncertainElection OppoCompetition set more offlocal controls Polity_xconst_Lag1 ///	 Prio_CWPast10   WB_GDPpc_Lag1Log ///	Ross_oilgas_valuePOP2000_Lag1LOG Finkel_SOC10 WB_pop_Lag1Log ///	  type3    Nelda_IncRun killedANY_Lag1local controls_SelIEM PreviousANYElobservedW46 OppoCompetition UncertainElection   WB_GDP_Lag1Log WB_GDPpc_Lag1Log year local controls_SelTEA Autocracy  AdvDem  WB_GDPpc_Lag1Log  Prio_CWPast10  UNPKO_dummy  type3 UncertainElection OppoCompetition etregress PreDay_killedInjuredLog `controls'  , treat(present46= `controls_SelIEM' )    vce(cluster cowcode)est store Table_2_3m1	etregress PreDay_killedInjuredLog `controls'   , treat(present46= `controls_SelIEM'  type3   Autocracy  AdvDem  Prio_CWPast10  UNPKO_dummy)  vce(cluster cowcode)est store Table_2_3m2etregress PreDay_killedInjuredLog `controls'   , treat(UNtech= `controls_SelTEA' ) vce(cluster cowcode)est store Table_2_3m3	etregress PreDay_killedInjuredLog `controls'   , treat(UNtech= `controls_SelTEA' PreviousANYElobservedW46 WB_GDP_Lag1Log year) vce(cluster cowcode)est store Table_2_3m4	etregress PreDay_killedInjuredLog `controls'    present46, treat(UNtech= `controls_SelTEA' PreviousANYElobservedW46 WB_GDP_Lag1Log year) vce(cluster cowcode)est store Table_2_3m5// Table 2.3 estout Table_2_3m*   ///	using Table_2_3.tex,   replace style(tex) eqlabels(none)  cells(b(fmt(%9.3f) star) ///	se(par fmt(%9.3f))) stats(N N_clust ll rho p_c, fmt(0 0 2 2)  label("Observations" "Clusters" "LL" "Rho" "Pr(Rho)")) ///	starlevels(* .1 ** .05 *** .01) label ///	order(present46 UNtech ///	Polity_xconst_Lag1 ///	Prio_CWPast10   WB_GDPpc_Lag1Log ///	Ross_oilgas_valuePOP2000_Lag1LOG Finkel_SOC10 WB_pop_Lag1Log ///	type3    Nelda_IncRun killedANY_Lag1 ///	UncertainElection PreviousANYElobservedW46 WB_GDP_Lag1Log  year type3 Autocracy  AdvDem UNPKO_dummy)************************************************** Table 3.1*************************************************use "Book_data.dta", clearset more offlocal controls Polity_xconst_Lag1 ///	 Prio_CWPast10   WB_GDPpc_Lag1Log ///	Ross_oilgas_valuePOP2000_Lag1LOG   Finkel_SOC10 WB_pop_Lag1Log ///	  type3 PreDay_killedInjured  LoserVoteSharezinb post_killedInjured  NegReport			  	`controls'   if  present46==1  , inflate (  WB_GDPpc_Lag1Log Prio_CWPast10 ) vce(cluster cowcode)est store Table_3_1m1zinb post_killedInjured  NegReport	 FraudPre  	`controls'   if  present46==1  , inflate (  WB_GDPpc_Lag1Log Prio_CWPast10 ) vce(cluster cowcode) difficult technique(bfgs)est store Table_3_1m2zinb post_killedInjured  NegReport			  	`controls'   if  Africa==1 & present46==1  , inflate (  WB_GDPpc_Lag1Log Prio_CWPast10 ) vce(cluster cowcode) difficult technique(bfgs)est store Table_3_1m3zinb post_killedInjured  NegReport	 FraudPre  	`controls'   if  Africa==1 & present46==1  , inflate (  WB_GDPpc_Lag1Log Prio_CWPast10 ) vce(cluster cowcode) est store Table_3_1m4// Table 3.1estout Table_3_1m*    ///	using Table_3_1.tex, replace style(tex) eqlabels(none)  cells(b(fmt(%9.3f) star) ///	se(par fmt(%9.3f))) stats(N N_clust ll , fmt(0 0 2) label("Observations" "Clusters" "LL" )) ///	starlevels(* .1 ** .05 *** .01) label ///	order(NegReport	 FraudPre Polity_xconst_Lag1 ///	Prio_CWPast10   WB_GDPpc_Lag1Log ///	Ross_oilgas_valuePOP2000_Lag1LOG   Finkel_SOC10 WB_pop_Lag1Log ///	type3 PreDay_killedInjured  LoserVoteShare)	  ************************************************** Figure 3.1*************************************************use "Book_data.dta", clearset more offlocal controls_loser  LoserVoteShare ///	Polity_xconst_Lag1 WB_GDPpc_Lag1Log type3 VDem_v2juhcind_ordLag1 ///	IncLost logit Challenge  i.NegReport	FraudPre  			`controls_loser'  if Africa==1 & present46==1  , vce(cluster cowcode)margins NegReport  if e(sample), atmeans marginsplot, graphregion(color(white))  scheme(lean1) legend(position(1) ring(0)) ///	ytitle("Probability of Post-Election Challenge") xtitle("Observer Condemnation") title("") ///	plotopts(msymbol(O) lcolor(none)) aspectratio(1.0) ///	xlabel(0 "no" 1 "yes") xscale(range(-1 (1) 2)) ///	yscale(range(0 (0.2) 1)) ylabel(#5) 	graph export "Figure_3_1.pdf", replace			 ************************************************** Figure 3.2 and Table 3.2* see R code and csv data in accompanying ISQ article (2019):* 	Book Figure 3.2 = Article Figure A1 in Article Online Appendix* 	Book Table 3.2 = Article Table A23 in Article Online Appendix* 	von Borzyskowski, Inken. 2019. “The Risks of Election Observation: International Condemnation and Post-Election Violence.” International Studies Quarterly 63 (3): 654-667.* 	Replication files and Online Appendix here: https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/LG3DWV*************************************************************************************************** Figure 3.3 - Latex*************************************************************************************************** Table 4.1 *************************************************use "Book_data.dta", clearset more offlocal controls Polity_xconst_Lag1 ///	 Prio_CWPast10 WB_GDPpc_Lag1Log ///	Ross_oilgas_valuePOP2000_Lag1LOG Finkel_SOC10 WB_pop_Lag1Log ///	  type3 PreDay_killedInjured  LoserVoteShare zinb post_killedInjured  UNtech			  FraudPre		 `controls' , inflate ( WB_GDPpc_Lag1Log Prio_CWPast10 ) vce(cluster cowcode)est store Table_4_1m1zinb post_killedInjured  UNtech	present46 FraudPre		 `controls'  , inflate ( WB_GDPpc_Lag1Log Prio_CWPast10 ) vce(cluster cowcode)   est store Table_4_1m2zinb post_killedInjured  UNtech			  FraudPre		`controls' if Africa==1 , inflate ( WB_GDPpc_Lag1Log Prio_CWPast10 ) vce(cluster cowcode)est store Table_4_1m3zinb post_killedInjured  UNtech	present46 FraudPre		`controls' if Africa==1 , inflate ( WB_GDPpc_Lag1Log Prio_CWPast10 ) vce(cluster cowcode)est store Table_4_1m4// Table 4.1estout Table_4_1m*     ///	using Table_4_1.tex, replace style(tex) eqlabels(none)  cells(b(fmt(%9.3f) star) ///	se(par fmt(%9.3f))) stats(N N_clust aic bic ll , fmt(0 0 2) label("Observations" "Clusters" "AIC" "BIC" "LL" )) ///	starlevels( * .1 ** .05 *** .01) label ///	order(UNtech FraudPre present46 ///	Polity_xconst_Lag1 ///	Prio_CWPast10 WB_GDPpc_Lag1Log ///	Ross_oilgas_valuePOP2000_Lag1LOG Finkel_SOC10 WB_pop_Lag1Log ///	type3 PreDay_killedInjured  LoserVoteShare)************************************************** Figure 4.1 results below saved in Figure_4_1.csv - graphing see R code based on that csv*************************************************use "Book_data.dta", clearset more offlocal controls_SelTEA Autocracy  AdvDem  WB_GDPpc_Lag1Log  Prio_CWPast10  ///	UNPKO_dummy  type3 UncertainElection OppoCompetition local controls_SelTEAextra PreviousANYElobservedW46 WB_GDP_Lag1Log yearlocal controls_main    Autocracy Prio_CWPast10  WB_GDPpc_Lag1Log local controls_loser FraudPre LoserVoteShare ///	Polity_xconst_Lag1 WB_GDPpc_Lag1Log type3 VDem_v2juhcind_ordLag1 ///	IncLost present46* NEC Capacityetregress VDEM_v2elembcap_ord VDEM_v2elembcap_ord_Lag1  `controls_main'  , ///	treat(UNtech= `controls_SelTEA' ) vce(cluster cowcode)est store Ch6mech1Aetregress VDEM_v2elembcap_ord VDEM_v2elembcap_ord_Lag1 `controls_main'      , ///	treat(UNtech= `controls_SelTEA' `controls_SelTEAextra' ) vce(cluster cowcode)est store Ch6mech1Betregress VDEM_v2elembcap_ord VDEM_v2elembcap_ord_Lag1  `controls_main'  if Africa==1 , ///	treat(UNtech= `controls_SelTEA' ) vce(cluster cowcode)est store Ch6mech2Aetregress VDEM_v2elembcap_ord VDEM_v2elembcap_ord_Lag1 `controls_main'  if Africa==1    , ///	treat(UNtech= `controls_SelTEA'  `controls_SelTEAextra' ) vce(cluster cowcode)est store Ch6mech2B* NEC autonomy	etregress  VDEM_v2elembaut_ord VDEM_v2elembaut_ord_Lag1 `controls_main'      , ///	treat(UNtech= `controls_SelTEA'    ) vce(cluster cowcode)est store Ch6mech3Aetregress   VDEM_v2elembaut_ord VDEM_v2elembaut_ord_Lag1 `controls_main' , ///	treat(UNtech= `controls_SelTEA'   `controls_SelTEAextra'  ) vce(cluster cowcode)est store Ch6mech3Betregress  VDEM_v2elembaut_ord VDEM_v2elembaut_ord_Lag1 `controls_main'  if Africa==1     , ///	treat(UNtech= `controls_SelTEA'    ) vce(cluster cowcode)est store Ch6mech4A	etregress   VDEM_v2elembaut_ord VDEM_v2elembaut_ord_Lag1 `controls_main'  if Africa==1, ///	treat(UNtech= `controls_SelTEA'   `controls_SelTEAextra'  ) vce(cluster cowcode)	est store Ch6mech4B* Voting Irregularities -- needs single stageetregress   VDEM_v2elirreg_ord VDEM_v2elirreg_ord_Lag1 `controls_main'      , ///	treat(UNtech= `controls_SelTEA'    ) vce(cluster cowcode)est store Ch6mech5Aetregress   VDEM_v2elirreg_ord VDEM_v2elirreg_ord_Lag1 `controls_main' , ///	treat(UNtech= `controls_SelTEA'   `controls_SelTEAextra'  ) vce(cluster cowcode)est store Ch6mech5Betregress   VDEM_v2elirreg_ord VDEM_v2elirreg_ord_Lag1 `controls_main'  if Africa==1     , ///	treat(UNtech= `controls_SelTEA'    ) vce(cluster cowcode)est store Ch6mech6Aetregress   VDEM_v2elirreg_ord VDEM_v2elirreg_ord_Lag1 `controls_main'  if Africa==1, ///	treat(UNtech= `controls_SelTEA'   `controls_SelTEAextra'  ) vce(cluster cowcode)est store Ch6mech6B	* Clean election INDEX etregress  VDEM_e_v2xel_frefair_ord  VDEM_e_v2xel_frefair_ordLag1 `controls_main'      , ///	treat(UNtech= `controls_SelTEA'    ) vce(cluster cowcode)est store Ch6mech7Aetregress  VDEM_e_v2xel_frefair_ord VDEM_e_v2xel_frefair_ordLag1 `controls_main'  , ///	treat(UNtech= `controls_SelTEA' `controls_SelTEAextra'     ) vce(cluster cowcode)est store Ch6mech7Betregress  VDEM_e_v2xel_frefair_ord  VDEM_e_v2xel_frefair_ordLag1 `controls_main' if Africa==1     , ///	treat(UNtech= `controls_SelTEA'      ) vce(cluster cowcode)est store Ch6mech8Aetregress  VDEM_e_v2xel_frefair_ord VDEM_e_v2xel_frefair_ordLag1 `controls_main'  if Africa==1, ///	treat(UNtech= `controls_SelTEA'  `controls_SelTEAextra'    ) vce(cluster cowcode)est store Ch6mech8B	* Accept election result -- needs single stageetregress VDEM_Challenge_ord VDEM_Challenge_ord_Lag1 `controls_loser'  , ///	treat(UNtech= `controls_SelTEA' ) vce(cluster cowcode)est store Ch6mech9Aetregress VDEM_Challenge_ord VDEM_Challenge_ord_Lag1 `controls_loser'  , ///	treat(UNtech= `controls_SelTEA'  `controls_SelTEAextra' ) vce(cluster cowcode)est store Ch6mech9Betregress VDEM_Challenge_ord VDEM_Challenge_ord_Lag1 `controls_loser'  if Africa==1, ///	treat(UNtech= `controls_SelTEA' ) vce(cluster cowcode)est store Ch6mech10A// Figure 4.1 estimates of interest (preliminary because some need single stage)estout Ch6mech*  using MechFigure.tex,   replace style(tex) eqlabels(none)  cells(b(fmt(%9.3f) star) ///se(par fmt(%9.3f))) drop (Autocracy  AdvDem  WB_GDPpc_Lag1Log  Prio_CWPast10  ///	UNPKO_dummy  type3 UncertainElection OppoCompetition ///	PreviousANYElobservedW46 WB_GDP_Lag1Log year ///	Autocracy Prio_CWPast10  WB_GDPpc_Lag1Log ///	FraudPre LoserVoteShare ///	Polity_xconst_Lag1 WB_GDPpc_Lag1Log type3 VDem_v2juhcind_ordLag1 ///	IncLost present46 ///	VDEM_v2elembcap_ord_Lag1 VDEM_e_v2xel_frefair_ordLag1 VDEM_Challenge_ord_Lag1 ///	 VDEM_v2elirreg_ord_Lag1  VDEM_v2elembaut_ord_Lag1 _cons ) ///	stats(rho p_c, fmt( 2 2))  ///	starlevels(* .1 ** .05 *** .01) label  * Single Stage models for outcomes VDEM_v2elirreg_ord and VDEM_Challenge_ordlocal controls_SelTEA  AdvDem  UNPKO_dummy  type3 UncertainElection OppoCompetition local controls_SelTEAextra PreviousANYElobservedW46 WB_GDP_Lag1Log yearlocal controls_main    Autocracy Prio_CWPast10  WB_GDPpc_Lag1Log  local controls_loser FraudPre LoserVoteShare  VDem_v2juhcind_ordLag1 IncLost present46reg  VDEM_v2elirreg_ord VDEM_v2elirreg_ord_Lag1 UNtech  `controls_main' `controls_SelTEA' , vce(cluster cowcode)est store Ch6mech5Areg  VDEM_v2elirreg_ord VDEM_v2elirreg_ord_Lag1 UNtech `controls_main' `controls_SelTEA' `controls_SelTEAextra' , vce(cluster cowcode)est store Ch6mech5B reg VDEM_v2elirreg_ord VDEM_v2elirreg_ord_Lag1 UNtech  `controls_main' `controls_SelTEA' if Africa==1 , vce(cluster cowcode)est store Ch6mech6Areg VDEM_v2elirreg_ord VDEM_v2elirreg_ord_Lag1 UNtech `controls_main' `controls_SelTEA' `controls_SelTEAextra' if Africa==1 , vce(cluster cowcode)est store Ch6mech6Breg VDEM_Challenge_ord UNtech VDEM_Challenge_ord_Lag1 `controls_loser' `controls_SelTEA', vce(cluster cowcode)est store Ch6mech9Areg VDEM_Challenge_ord UNtech VDEM_Challenge_ord_Lag1 `controls_loser'  `controls_SelTEA'  `controls_SelTEAextra' , vce(cluster cowcode)est store Ch6mech9Breg VDEM_Challenge_ord UNtech VDEM_Challenge_ord_Lag1 `controls_loser'  `controls_SelTEA' if Africa==1,  vce(cluster cowcode)est store Ch6mech10Areg VDEM_Challenge_ord UNtech VDEM_Challenge_ord_Lag1 `controls_loser' `controls_SelTEA'  `controls_SelTEAextra'  if Africa==1 , vce(cluster cowcode)est store Ch6mech10B// Figure 4.1 estimates of interest (final with single stage for some)estout Ch6mech*  using MechFigure.tex,   replace style(tex) eqlabels(none)  cells(b(fmt(%9.3f) star) ///se(par fmt(%9.3f))) drop (Autocracy  AdvDem  WB_GDPpc_Lag1Log  Prio_CWPast10  ///	UNPKO_dummy  type3 UncertainElection OppoCompetition ///	PreviousANYElobservedW46 WB_GDP_Lag1Log year ///	Autocracy Prio_CWPast10  WB_GDPpc_Lag1Log ///	FraudPre LoserVoteShare ///	 WB_GDPpc_Lag1Log type3 VDem_v2juhcind_ordLag1 ///	IncLost present46 ///	VDEM_v2elembcap_ord_Lag1 VDEM_e_v2xel_frefair_ordLag1 VDEM_Challenge_ord_Lag1 ///	 VDEM_v2elirreg_ord_Lag1  _cons ) ///	stats(rho p_c, fmt( 2 2))  ///	starlevels(* .1 ** .05 *** .01) label  ************************************************** Figure 4.2  *************************************************use "Figure_4_2.dta", cleargraph twoway (scatter ElUNBefore  TrustNEC_Change if ElUNBefore==0, jitter(10 10)) ///	(scatter ElUNBefore  TrustNEC_Change if ElUNBefore==1, jitter(10 10)), ///	 xline(0, lpattern(dash)) ///	scheme(lean1) ylabel(0 "no" 1 "yes")  ///	xtitle("Change in Trust in National Election Commission") ///	ytitle("Technical Election Assistance") ///	yscale(range(-1 (1) 2)) ///	legend(label(2 "Technical assistance") label(1 "No technical assistance") ring(0) position(11) bmargin(large) order(2 1)) graph export "Figure_4_2.pdf", replace************************************************** Tables 4.2, 4.3 - Latex*************************************************************************************************** APPENDICES*************************************************	************************************************** Appendix Figure 1B.1, 1B.2, 1B.3 - Latex* Appendix Table  1C.1 - Latex*************************************************	*************************************************	* Appendix Table 1C.2 *************************************************use "Book_data.dta", clear	sutex PreDay_killedInjured post_killedInjured ///	UNtech present46 ObsTA NegReport   ///	Challenge /// 	VDEM_Challenge_ord VDEM_v2elembcap_ord VDEM_v2elembaut_ord  ///	VDEM_v2elirreg_ord VDEM_e_v2xel_frefair_ord ///	Polity_xconst_Lag1 ///	Prio_CWPast10   WB_GDPpc_Lag1Log ///	Ross_oilgas_valuePOP2000_Lag1LOG WB_pop_Lag1Log Finkel_SOC10  ///	Nelda_IncRun LoserVoteShare type3     ///	killedANY_Lag1 FraudPre   ///	previousELsuspended FirstMultiParty TransitionalGovmt  UncertainElection  OppoCompetition    ///	PreviousANYElobservedW46 WB_GDP_Lag1Log year ///	UNPKO_dummy Autocracy  Hybrid AdvDem VDem_v2juhcind_ordLag1, ///	minmax digits(2) label ///	file(AppendixTable_1_C_2.tex ) replace		************************************************** Appendix Table 1C.3 - Latex*************************************************	************************************************** Appendix Table 1C.4*************************************************	use "Book_data.dta", clearcollapse year, by(COUNTRY_NAME)texsave COUNTRY_NAME using AppendixTable_1_C_4.tex , replace varlabels 	************************************************** Appendix Table 3A.1 *************************************************	use "Book_data.dta", clearset more offlocal controls_loser  LoserVoteShare ///	Polity_xconst_Lag1 WB_GDPpc_Lag1Log type3 VDem_v2juhcind_ordLag1 ///	IncLost logit Challenge  NegReport			  			`controls_loser'  if  present46==1  , vce(cluster cowcode)est store Table_3_A_1m1logit Challenge  NegReport	FraudPre  			`controls_loser'  if  present46==1  , vce(cluster cowcode)est store Table_3_A_1m2logit Challenge NegReport			  			`controls_loser'  if  Africa==1 & present46==1  , vce(cluster cowcode)est store Table_3_A_1m3logit Challenge  NegReport	FraudPre  			`controls_loser'  if Africa==1 & present46==1  , vce(cluster cowcode)est store Table_3_A_1m4// Appendix Table 3A.1estout Table_3_A_1m*    ///	using Table_3_A_1.tex, replace style(tex) eqlabels(none)  cells(b(fmt(%9.3f) star) ///	se(par fmt(%9.3f))) stats(N N_clust ll , fmt(0 0 2) label("Observations" "Clusters" "LL" )) ///	starlevels(* .1 ** .05 *** .01) label ///	order(NegReport	FraudPre LoserVoteShare VDem_v2juhcind_ordLag1 ///	Polity_xconst_Lag1 WB_GDPpc_Lag1Log type3 VDem_v2juhcind_ordLag1 ///	IncLost )************************************************** Appendix Table 3A.2*************************************************	use "Book_data.dta", clear	set more offlocal controls Polity_xconst_Lag1 ///	 Prio_CWPast10   WB_GDPpc_Lag1Log ///	Ross_oilgas_valuePOP2000_Lag1LOG Finkel_SOC10 WB_pop_Lag1Log ///	  type3 PreDay_killedInjured  LoserVoteShare  zinb post_killedInjured  Challenge	 		`controls'  if present46==1 , inflate (  WB_GDPpc_Lag1Log Prio_CWPast10 ) vce(cluster cowcode)est store Table_3_A_2m1zinb post_killedInjured  Challenge FraudPre	`controls'  if present46==1 , inflate (  WB_GDPpc_Lag1Log Prio_CWPast10 ) vce(cluster cowcode)  difficult technique(bfgs)est store Table_3_A_2m2zinb post_killedInjured  Challenge	 		`controls'   if  Africa==1 & present46==1, inflate (  WB_GDPpc_Lag1Log Prio_CWPast10 ) vce(cluster cowcode) est store Table_3_A_2m3zinb post_killedInjured  Challenge FraudPre	`controls'   if  Africa==1 & present46==1 , inflate (  WB_GDPpc_Lag1Log Prio_CWPast10 ) vce(cluster cowcode) est store Table_3_A_2m4// Appendix Table 3A.2estout Table_3_A_2m*    ///	using Table_3_A_2.tex, replace style(tex) eqlabels(none)  cells(b(fmt(%9.3f) star) ///	se(par fmt(%9.3f))) stats(N N_clust ll , fmt(0 0 2) label("Observations" "Clusters" "LL" )) ///	starlevels(* .1 ** .05 *** .01) label ///	order(Challenge FraudPre Polity_xconst_Lag1 ///	 Prio_CWPast10   WB_GDPpc_Lag1Log ///	Ross_oilgas_valuePOP2000_Lag1LOG Finkel_SOC10 WB_pop_Lag1Log ///	  type3 PreDay_killedInjured  LoserVoteShare  )************************************************** Appendix Table 3A.3*************************************************	use "Book_data.dta", clearset more offeststo clearlocal controls Polity_xconst_Lag1 ///	 Prio_CWPast10   WB_GDPpc_Lag1Log ///	Ross_oilgas_valuePOP2000_Lag1LOG Finkel_SOC10 WB_pop_Lag1Log ///	  type3 PreDay_killedInjuredLog  LoserVoteShare  local predCondemn PreDay_killedInjuredLog FraudPre 					WB_ODA_Lag1mPCLog FirstMultiParty  local predCondemn2 PreDay_killedInjuredLog FraudPre  WB_GDPpc_Lag1Log   WB_ODA_Lag1mPCLog FirstMultiParty etregress post_killedInjuredlog    			`controls'   , treat(NegReport =  `predCondemn'  ) cluster(cowcode) est store Table_3_A_3m1estadd scalar exog2 = e(p_c)etregress post_killedInjuredlog FraudPre  	`controls'   , treat(NegReport =  `predCondemn'  ) cluster(cowcode) est store Table_3_A_3m2estadd scalar exog2 = e(p_c)etregress post_killedInjuredlog FraudPre  	`controls'   , treat(NegReport =  `predCondemn2'  ) cluster(cowcode) est store Table_3_A_3m3estadd scalar exog2 = e(p_c)etregress post_killedInjuredlog FraudPre  	`controls'   , treat(NegReport =  `predCondemn2' IncLost ) cluster(cowcode) est store Table_3_A_3m4estadd scalar exog2 = e(p_c)// Appendix Table 3A.3estout Table_3_A_3m* using Table_3_A_3.tex, replace style(tex) eqlabels(none)  label cells(b(fmt(%9.3f) star) ///	se(par fmt(%9.3f))) stats(rho p_c N N_clust ll , fmt(2 2 0 0 2)  label( "Rho" "Pr(Rho)" "Observations" "Clusters" "LL")) ///	starlevels(* .1 ** .05 *** .01) ///	order(NegReport FraudPre ///	Polity_xconst_Lag1 ///	 Prio_CWPast10   WB_GDPpc_Lag1Log ///	Ross_oilgas_valuePOP2000_Lag1LOG Finkel_SOC10 WB_pop_Lag1Log LoserVoteShare ///	  type3 PreDay_killedInjuredLog )						